package com.shierke.Ume.ui.adapter.me

import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.shierke.Ume.R
import com.shierke.Ume.bean.VipBannerBean
import com.youth.banner.adapter.BannerAdapter

/**
 * Create by Ybx
 * on 2020-10-18
 * Desribe:
 */
class VipBannerAdapter(datas: ArrayList<VipBannerBean>) :
    BannerAdapter<VipBannerBean, VipBannerAdapter.BannerViewHolder>(datas) {

    override fun onCreateHolder(parent: ViewGroup?, viewType: Int): BannerViewHolder {




        if (viewType ==1){
            val view =
                LayoutInflater.from(parent!!.context).inflate(R.layout.item_vip_banner, parent, false)
            return BannerViewHolder(view)
        }else{
            val view =
                LayoutInflater.from(parent!!.context).inflate(R.layout.item_vip_banner1, parent, false)
            return BannerViewHolder(view)
        }


    }

    override fun onBindView(
        holder: BannerViewHolder?,
        data: VipBannerBean?,
        position: Int,
        size: Int
    ) {
        holder!!.onBind()

    }


    override fun getItemViewType(position: Int): Int {
        return if (position == 0) {
            1
        } else {
            2
        }
    }

    class BannerViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {

        fun onBind() {


        }
    }
}